Skip to content

[v26.1.x] ct: reconcilation pending offset lag metric#30345

Open
vbotbuildovich wants to merge 2 commits intoredpanda-data:v26.1.xfrom
vbotbuildovich:backport-pr-30148-v26.1.x-647
Open

[v26.1.x] ct: reconcilation pending offset lag metric#30345
vbotbuildovich wants to merge 2 commits intoredpanda-data:v26.1.xfrom
vbotbuildovich:backport-pr-30148-v26.1.x-647

Conversation

@vbotbuildovich
Copy link
Copy Markdown
Collaborator

Backport of PR #30148

Add a `source_probe` class that registers a pending_offset_lag gauge per
partition, labeled with namespace/topic/partition. The probe is owned by
the source base class and its metric lifecycle follows the source's.

The gauge invokes the source's `pending_offset_lag()` calculation on
scrape via a back-reference, so the metric always reflects current state
without requiring explicit updates each reconciliation tick.

Also add `pending_offset_lag()` as a virtual method on the source
interface, implemented in `l0_source` as `LSO - next_offset(LRO)`.

(cherry picked from commit bdd6465)
Add `pending_offset_lag()` to fake_source and two test cases:
`PendingOffsetLag` verifies the metric reflects pending offsets
immediately when data arrives and drops to zero after reconciliation.
`PendingOffsetLagDetach` verifies the metric is deregistered when the
source is destroyed.

(cherry picked from commit b9167d1)
@vbotbuildovich vbotbuildovich added this to the v26.1.x-next milestone Apr 29, 2026
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build area/redpanda kind/backport PRs targeting a stable branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants